library CorpsmanAntiVenom initializer init 


	private function Trig_CorpsmanAV_Conditions takes nothing returns boolean
		return GetSpellAbilityId()=='A025'
	endfunction

	private function Trig_CorpsmanAV_Actions takes nothing returns nothing
		local unit u = GetSpellTargetUnit()
		local integer i = 1
		loop
			exitwhen i > 3
			call UnitRemoveAbility(u,'Bpoi')
			call UnitRemoveAbility(u,'Bpsd')
			call UnitRemoveAbility(u,'B008')
			call UnitRemoveAbility(u,'B00B')
			call UnitRemoveAbility(u,'BNpa')
			call UnitRemoveAbility(u,'BNpm')
			call UnitRemoveAbility(u,'Bapl')
			call UnitRemoveAbility(u,'Bplg')
			call UnitRemoveAbility(u,'A08B') //Infection Ability
			call UnitRemoveAbility(u,'BEah') //Infection Buff
			
			
			set i = i + 1
		endloop
		set u = null
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		set t = CreateTrigger(  )
		call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
		call TriggerAddCondition( t, Condition( function Trig_CorpsmanAV_Conditions ) )
		call TriggerAddAction( t, function Trig_CorpsmanAV_Actions )
	endfunction
endlibrary